a. Field of the Invention
The present invention pertains generally to redundant arrays of independent disks (RAID) and specifically to reconstruction of data on RAID devices.
b. Description of the Background
Redundant arrays of independent disks (RAID) is standardized technology for the storage of data with emphasis on performance, fault tolerance, and the ability to recover data due to a failure of a disk drive. Many RAID products are commercially available.
The RAID Advisory Board of St. Peter, Minn. has defined and standardized several different RAID levels. RAID level 1 (‘RAID 1’), for example, is a mirrored disk wherein a complete copy of the data on one disk is simultaneously maintained and stored on a second disk. In the event of a failure of one disk, a complete copy of the data on the second disk is available. The data on the second disk may be used to recreate the data on the first disk when the first disk is replaced or repaired. RAID 5 uses several disks to store data. The data is stored in stripes, meaning that for a large block of data, some will be written to the first drive, some to the second drive, and so forth. Several disks can write in parallel, thus increasing the data throughput by a multiple of the number of available disks. RAID 5 uses parity as a method to store redundancy information. Parity is computed by performing the exclusive OR (XOR) function to the data on each block of the stripe. Other RAID levels exist with different variations of performance and cost tradeoffs.
FIG. 1 illustrates the concept of creating parity in the RAID 5 standard. The data blocks 102, 104, 106, and 108 are a single stripe. The data blocks are combined using the XOR function to calculate the parity. In the present illustration, the parity 110 is stored on drive 2. Parity can be used to reconstruct data that is lost on any one drive.
FIG. 2 illustrates the placement of data and parity across the various disk drives in the RAID 5 standard when there are five drives in the array. The drives 202, 204, 206, 208, and 210 are shown in columns while the individual stripes are shown in rows such as 212 and 214. For the first stripe 212, the data 216, 218, 220, and 222 are written onto drives 0–3 and the parity 224 to drive 4. For the second stripe 214, the data 226, 228, 230, and 232 are written to drives 0, 1, 2, and 4 and the parity 234 to drive 3. In this manner, the parity is equally divided amongst all of the drives. In some RAID levels, a dedicated disk is allocated to storing the parity.
FIG. 3 illustrates how data can be reconstructed when one of the disk drives fails in a RAID 5 system. In the present illustration, drive 4 has failed, leaving the data 302 unreadable. The data 312 can be reconstructed by combining the remaining data 304, 306, and 310 with the parity 308 using the XOR function.
If any one drive fails in a system, the data contained on the failed drive can be reconstructed. When the data from the failed drive is requested, the XOR function of the data on the stripe will be used to reconstruct the requested data. This can be done on the fly. When the system is operating in such a state, it is classified as a degraded state. The system can operate in a degraded state until another drive fails, at which time the system is dead. When two drives fail, the parity and the remaining drives are not sufficient to reconstruct the missing data and the system halts.
When the drive fails and is replaced, the system will rebuild the data onto the replaced drive using the XOR function. The rebuilding process is to take the data and parity from the other drives, reconstruct the data block using the XOR function, and write the reconstructed data onto the new disk. When the rebuilding process is completed, the fully populated RAID system will return to a fully operational or ‘optimal’ state.
It is not unusual for a drive to have a failure in a single block of data such as with a media error. In a fully operational RAID 5 system, the failure of a single block of data would be reconstructed and the system would function as normal. However, if a single block of data has failed in an otherwise good drive during a rebuilding process, a failure will occur and the rebuild process will typically halt, leaving the system in a degraded state. The rebuild process cannot continue at that point, as there is insufficient data to fully rebuild the replaced drive.
If two blocks of data in a single stripe have failed, such as with a media error on the individual blocks of data, the remaining blocks of data in the stripe are still valid data. However, the blocks of the failed drives have data that are permanently lost. During a read operation, the RAID system can typically return an error message in place of the lost data without halting operation.
It would therefore be advantageous to provide a method for continuing a rebuilding process when a single failed block is encountered.